package com.lavender.annotation._import;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author: zhu.chen
 * @date: 2020/12/5
 * @version: v1.0.0
 */
public class ImportTestBeanDefinitionRegister implements ImportBeanDefinitionRegistrar {

    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
        BeanDefinitionBuilder importTest = BeanDefinitionBuilder.rootBeanDefinition(ImportTest.class);
        registry.registerBeanDefinition("importTest", importTest.getBeanDefinition());
    }

}
